import https from '@/utils/request'
import type { GResponse, PaginateResult } from '@/types/common'
import { CodeFragments } from '@/types/code'


export const generateUrl = (params: any):GResponse<any> => https.post('/api/post', params)

export const getCodeById = (id: string, password: string):GResponse<CodeFragments> => https.get(`/api/post/${id}`, {params: {password}})

export const modifyCodeById = (id: string, params: any):GResponse<CodeFragments> => https.put(`/api/post/${id}`, params)
